//书写商品的相关的 api 接口

import request from '@/utils/requiest'

//参数的类型限制
interface MyhotListParams{
    count?: number,
    limitNum?: number
}

//1.秒杀 商品接口
export  const hotListApi  = (info:MyhotListParams ) =>request.get('/pro/seckilllist',{
    params:info
})

//2. 热门搜索的接口
export const hotSearchApi =() => request.get('/pro/hotword')


// 3. 模糊搜索的接口
export const searchApi = (keyword: string, count?: number) =>request.get('/pro/search', {
    params:{keyword}
})

// 4. 
export const goodsListApi = (info:{count: number, limitNum: number}) =>request.get('/pro/list', {  
   params: info
})


//  产品的分类列表
export const cateListApi  = () =>request.get('/pro/categorylist')


//产品分类的 品牌列表接口
export const categoryApi  = (cate: string) => request.get('/pro/categorybrandlist',{
    params: {category: cate}
})

// 分类下某品牌的 产品列表

export const categoryBrandProListApi = (info:{category: string,brand: string}) =>request.get('/pro/categorybrandprolist',{
    params:info
})

// 2.请求商品  详细信息
export const detailApi = (id: string) =>request.get(`/pro/detail/${id}`)